<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<script>
function Rectangle(opt){
    // ctrl + alt + l
    this._init(opt);
}
Rectangle.prototype = {
    _init : function (opt){
        this.w = opt.w;
        this.h = opt.h;
    },
    area : function (){
        return this.w * this.h;
    },
    perimeter : function (){
        return 2 * this.w + 2 * this.h;
    }
}
</script>
</body>
</html>